home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50a Issue 142 (CD142a) (August 1998).iso / trial / demon / TURNPIKE.1 / CLASSES.ZIP / MS / APPLET / AppletViewerPanel.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-04-14  |  1.2 KB  |  44 lines

  1. package ms.applet;
  2.  
  3. import java.applet.AppletContext;
  4. import java.awt.Component;
  5. import java.net.MalformedURLException;
  6. import java.net.URL;
  7. import java.util.Hashtable;
  8.  
  9. class AppletViewerPanel extends AppletPanel {
  10.    URL codebaseURL;
  11.    URL docbaseURL;
  12.    Hashtable atts;
  13.  
  14.    AppletViewerPanel(AppletViewer var1, Hashtable var2) {
  15.       super(var1);
  16.       this.atts = var2;
  17.  
  18.       try {
  19.          String var3 = this.getParameter("documentbase");
  20.          String var4 = this.getParameter("codebase");
  21.          this.codebaseURL = new URL(var4);
  22.          this.docbaseURL = new URL(var3);
  23.       } catch (MalformedURLException var5) {
  24.          ((Throwable)var5).printStackTrace();
  25.       }
  26.    }
  27.  
  28.    public String getParameter(String var1) {
  29.       return (String)this.atts.get(var1.toLowerCase());
  30.    }
  31.  
  32.    public URL getCodeBase() {
  33.       return this.codebaseURL;
  34.    }
  35.  
  36.    public URL getDocumentBase() {
  37.       return this.docbaseURL;
  38.    }
  39.  
  40.    public AppletContext getAppletContext() {
  41.       return (AppletContext)((Component)this).getParent();
  42.    }
  43. }
  44.